from flask import Blueprint, request
from service.detect_result_service import DetectResultService
from flask_jwt_extended import jwt_required

detect_result_api = Blueprint('detect_result_api', __name__)


@detect_result_api.route('/selectAll', methods=["GET"])
@jwt_required()
def selectAll():
    data = {
        'page': request.args.get('page', type=int),
        'per_page': request.args.get('per_page', type=int)
    }
    return DetectResultService.selectAll(data)

@detect_result_api.route('/selectByUserEmail', methods=["GET"])
@jwt_required()
def selectByUserEmail():
    return DetectResultService.selectByUserEmail(request.get_json())

